home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Terminals.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  12.1 KB  |  497 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Terminals.a
  3. ;
  4. ;    Contains:    Communications Toolbox Terminal tool Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1988-1993, 1995-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__TERMINALS__') = 'UNDEFINED' THEN
  19. __TERMINALS__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  25.     include 'Dialogs.a'
  26.     ENDIF
  27.     IF &TYPE('__CTBUTILITIES__') = 'UNDEFINED' THEN
  28.     include 'CTBUtilities.a'
  29.     ENDIF
  30.     IF &TYPE('__CONNECTIONS__') = 'UNDEFINED' THEN
  31.     include 'Connections.a'
  32.     ENDIF
  33.  
  34.  
  35. curTMVersion                    EQU        2                    ; current Terminal Manager version 
  36.  
  37. curTermEnvRecVers                EQU        0                    ; current Terminal Manager Environment Record version 
  38.  
  39.                                                             ; error codes    
  40. tmGenericError                    EQU        -1
  41. tmNoErr                            EQU        0
  42. tmNotSent                        EQU        1
  43. tmEnvironsChanged                EQU        2
  44. tmNotSupported                    EQU        7
  45. tmNoTools                        EQU        8
  46. ; typedef OSErr                         TMErr
  47.  
  48.  
  49. tmInvisible                        EQU        $01
  50. tmSaveBeforeClear                EQU        $02
  51. tmNoMenus                        EQU        $04
  52. tmAutoScroll                    EQU        $08
  53. tmConfigChanged                    EQU        $10
  54. ; typedef unsigned long                 TMFlags
  55.  
  56.  
  57. selTextNormal                    EQU        $01
  58. selTextBoxed                    EQU        $02
  59. selGraphicsMarquee                EQU        $04
  60. selGraphicsLasso                EQU        $08
  61. tmSearchNoDiacrit                EQU        $0100
  62. tmSearchNoCase                    EQU        $0200
  63. ; typedef unsigned short                 TMSearchTypes
  64.  
  65. ; typedef short                         TMSelTypes
  66.  
  67.  
  68. cursorText                        EQU        1
  69. cursorGraphics                    EQU        2
  70. ; typedef unsigned short                 TMCursorTypes
  71.  
  72.  
  73. tmTextTerminal                    EQU        $01
  74. tmGraphicsTerminal                EQU        $02
  75. ; typedef unsigned short                 TMTermTypes
  76.  
  77. TermDataBlock            RECORD 0
  78. flags                     ds.w    1                ; offset: $0 (0)
  79. theData                     ds.l    1                ; offset: $2 (2)
  80. auxData                     ds.l    1                ; offset: $6 (6)
  81. reserved                 ds.l    1                ; offset: $A (10)
  82. sizeof                     EQU *                    ; size:   $E (14)
  83.                         ENDR
  84. ; typedef struct TermDataBlock *        TermDataBlockPtr
  85.  
  86. ; typedef TermDataBlockPtr *            TermDataBlockH
  87.  
  88. ; typedef TermDataBlockPtr *            TermDataBlockHandle
  89.  
  90. TermEnvironRec            RECORD 0
  91. version                     ds.w    1                ; offset: $0 (0)
  92. termType                 ds.w    1                ; offset: $2 (2)
  93. textRows                 ds.w    1                ; offset: $4 (4)
  94. textCols                 ds.w    1                ; offset: $6 (6)
  95. cellSize                 ds        Point            ; offset: $8 (8)
  96. graphicSize                 ds        Rect            ; offset: $C (12)
  97. slop                     ds        Point            ; offset: $14 (20)
  98. auxSpace                 ds        Rect            ; offset: $18 (24)
  99. sizeof                     EQU *                    ; size:   $20 (32)
  100.                         ENDR
  101. ; typedef struct TermEnvironRec *        TermEnvironPtr
  102.  
  103. TMSelection                RECORD 0
  104. selRect                     ds        Rect            ; offset: $0 (0)
  105.                          ORG 0
  106. selRgnHandle             ds.l    1                ; offset: $0 (0)
  107.                          ORG 8
  108. sizeof                     EQU *                    ; size:   $8 (8)
  109.                         ENDR
  110.  
  111.  
  112. ; typedef TermRecord *                    TermPtr
  113.  
  114. ; typedef TermPtr *                        TermHandle
  115.  
  116. ;     TMTermTypes     
  117. TermRecord                RECORD 0
  118. procID                     ds.w    1                ; offset: $0 (0)
  119. flags                     ds.l    1                ; offset: $2 (2)
  120. errCode                     ds.w    1                ; offset: $6 (6)
  121. refCon                     ds.l    1                ; offset: $8 (8)
  122. userData                 ds.l    1                ; offset: $C (12)
  123. defProc                     ds.l    1                ; offset: $10 (16)
  124. config                     ds.l    1                ; offset: $14 (20)
  125. oldConfig                 ds.l    1                ; offset: $18 (24)
  126. environsProc             ds.l    1                ; offset: $1C (28)
  127. reserved1                 ds.l    1                ; offset: $20 (32)
  128. reserved2                 ds.l    1                ; offset: $24 (36)
  129. tmPrivate                 ds.l    1                ; offset: $28 (40)
  130. sendProc                 ds.l    1                ; offset: $2C (44)
  131. breakProc                 ds.l    1                ; offset: $30 (48)
  132. cacheProc                 ds.l    1                ; offset: $34 (52)
  133. clikLoop                 ds.l    1                ; offset: $38 (56)
  134. owner                     ds.l    1                ; offset: $3C (60)
  135. termRect                 ds        Rect            ; offset: $40 (64)
  136. viewRect                 ds        Rect            ; offset: $48 (72)
  137. visRect                     ds        Rect            ; offset: $50 (80)
  138. lastIdle                 ds.l    1                ; offset: $58 (88)
  139. selection                 ds        TMSelection        ; offset: $5C (92)
  140. selType                     ds.w    1                ; offset: $64 (100)
  141. mluField                 ds.l    1                ; offset: $66 (102)
  142. sizeof                     EQU *                    ; size:   $6A (106)
  143.                         ENDR
  144.  
  145. ;
  146. ; pascal TMErr InitTM(void )
  147. ;
  148.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  149.         IMPORT_CFM_FUNCTION InitTM
  150.     ENDIF
  151.  
  152. ;
  153. ; pascal Handle TMGetVersion(TermHandle hTerm)
  154. ;
  155.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  156.         IMPORT_CFM_FUNCTION TMGetVersion
  157.     ENDIF
  158.  
  159. ;
  160. ; pascal short TMGetTMVersion(void )
  161. ;
  162.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  163.         IMPORT_CFM_FUNCTION TMGetTMVersion
  164.     ENDIF
  165.  
  166. ;
  167. ; pascal TermHandle TMNew(const Rect *termRect, const Rect *viewRect, TMFlags flags, short procID, WindowPtr owner, TerminalSendUPP sendProc, TerminalCacheUPP cacheProc, TerminalBreakUPP breakProc, TerminalClikLoopUPP clikLoop, TerminalEnvironsUPP environsProc, long refCon, long userData)
  168. ;
  169.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  170.         IMPORT_CFM_FUNCTION TMNew
  171.     ENDIF
  172.  
  173. ;
  174. ; pascal void TMDispose(TermHandle hTerm)
  175. ;
  176.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  177.         IMPORT_CFM_FUNCTION TMDispose
  178.     ENDIF
  179.  
  180. ;
  181. ; pascal void TMKey(TermHandle hTerm, const EventRecord *theEvent)
  182. ;
  183.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  184.         IMPORT_CFM_FUNCTION TMKey
  185.     ENDIF
  186.  
  187. ;
  188. ; pascal void TMUpdate(TermHandle hTerm, RgnHandle visRgn)
  189. ;
  190.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  191.         IMPORT_CFM_FUNCTION TMUpdate
  192.     ENDIF
  193.  
  194. ;
  195. ; pascal void TMPaint(TermHandle hTerm, const TermDataBlock *theTermData, const Rect *theRect)
  196. ;
  197.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  198.         IMPORT_CFM_FUNCTION TMPaint
  199.     ENDIF
  200.  
  201. ;
  202. ; pascal void TMActivate(TermHandle hTerm, Boolean activate)
  203. ;
  204.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  205.         IMPORT_CFM_FUNCTION TMActivate
  206.     ENDIF
  207.  
  208. ;
  209. ; pascal void TMResume(TermHandle hTerm, Boolean resume)
  210. ;
  211.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  212.         IMPORT_CFM_FUNCTION TMResume
  213.     ENDIF
  214.  
  215. ;
  216. ; pascal void TMClick(TermHandle hTerm, const EventRecord *theEvent)
  217. ;
  218.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  219.         IMPORT_CFM_FUNCTION TMClick
  220.     ENDIF
  221.  
  222. ;
  223. ; pascal void TMIdle(TermHandle hTerm)
  224. ;
  225.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  226.         IMPORT_CFM_FUNCTION TMIdle
  227.     ENDIF
  228.  
  229. ;
  230. ; pascal long TMStream(TermHandle hTerm, void *theBuffer, long theLength, CMFlags flags)
  231. ;
  232.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  233.         IMPORT_CFM_FUNCTION TMStream
  234.     ENDIF
  235.  
  236. ;
  237. ; pascal Boolean TMMenu(TermHandle hTerm, short menuID, short item)
  238. ;
  239.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  240.         IMPORT_CFM_FUNCTION TMMenu
  241.     ENDIF
  242.  
  243. ;
  244. ; pascal void TMReset(TermHandle hTerm)
  245. ;
  246.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  247.         IMPORT_CFM_FUNCTION TMReset
  248.     ENDIF
  249.  
  250. ;
  251. ; pascal void TMClear(TermHandle hTerm)
  252. ;
  253.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  254.         IMPORT_CFM_FUNCTION TMClear
  255.     ENDIF
  256.  
  257. ;
  258. ; pascal void TMResize(TermHandle hTerm, const Rect *newViewRect)
  259. ;
  260.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  261.         IMPORT_CFM_FUNCTION TMResize
  262.     ENDIF
  263.  
  264. ;
  265. ; pascal long TMGetSelect(TermHandle hTerm, Handle theData, ResType *theType)
  266. ;
  267.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  268.         IMPORT_CFM_FUNCTION TMGetSelect
  269.     ENDIF
  270.  
  271. ;
  272. ; pascal void TMGetLine(TermHandle hTerm, short lineNo, TermDataBlock *theTermData)
  273. ;
  274.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  275.         IMPORT_CFM_FUNCTION TMGetLine
  276.     ENDIF
  277.  
  278. ;
  279. ; pascal void TMSetSelection(TermHandle hTerm, const TMSelection *theSelection, TMSelTypes selType)
  280. ;
  281.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  282.         IMPORT_CFM_FUNCTION TMSetSelection
  283.     ENDIF
  284.  
  285. ;
  286. ; pascal void TMScroll(TermHandle hTerm, short dh, short dv)
  287. ;
  288.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  289.         IMPORT_CFM_FUNCTION TMScroll
  290.     ENDIF
  291.  
  292. ;
  293. ; pascal Boolean TMValidate(TermHandle hTerm)
  294. ;
  295.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  296.         IMPORT_CFM_FUNCTION TMValidate
  297.     ENDIF
  298.  
  299. ;
  300. ; pascal void TMDefault(Ptr *theConfig, short procID, Boolean allocate)
  301. ;
  302.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  303.         IMPORT_CFM_FUNCTION TMDefault
  304.     ENDIF
  305.  
  306. ;
  307. ; pascal Handle TMSetupPreflight(short procID, long *magicCookie)
  308. ;
  309.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  310.         IMPORT_CFM_FUNCTION TMSetupPreflight
  311.     ENDIF
  312.  
  313. ;
  314. ; pascal void TMSetupSetup(short procID, const void *theConfig, short count, DialogPtr theDialog, long *magicCookie)
  315. ;
  316.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  317.         IMPORT_CFM_FUNCTION TMSetupSetup
  318.     ENDIF
  319.  
  320. ;
  321. ; pascal Boolean TMSetupFilter(short procID, const void *theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie)
  322. ;
  323.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  324.         IMPORT_CFM_FUNCTION TMSetupFilter
  325.     ENDIF
  326.  
  327. ;
  328. ; pascal void TMSetupItem(short procID, const void *theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie)
  329. ;
  330.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  331.         IMPORT_CFM_FUNCTION TMSetupItem
  332.     ENDIF
  333.  
  334. ;
  335. ; pascal void TMSetupXCleanup(short procID, const void *theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie)
  336. ;
  337.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  338.         IMPORT_CFM_FUNCTION TMSetupXCleanup
  339.     ENDIF
  340.  
  341. ;
  342. ; pascal void TMSetupPostflight(short procID)
  343. ;
  344.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  345.         IMPORT_CFM_FUNCTION TMSetupPostflight
  346.     ENDIF
  347.  
  348. ;
  349. ; pascal Ptr TMGetConfig(TermHandle hTerm)
  350. ;
  351.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  352.         IMPORT_CFM_FUNCTION TMGetConfig
  353.     ENDIF
  354.  
  355. ;
  356. ; pascal short TMSetConfig(TermHandle hTerm, const void *thePtr)
  357. ;
  358.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  359.         IMPORT_CFM_FUNCTION TMSetConfig
  360.     ENDIF
  361.  
  362. ;
  363. ; pascal OSErr TMIntlToEnglish(TermHandle hTerm, const void *inputPtr, Ptr *outputPtr, short language)
  364. ;
  365.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  366.         IMPORT_CFM_FUNCTION TMIntlToEnglish
  367.     ENDIF
  368.  
  369. ;
  370. ; pascal OSErr TMEnglishToIntl(TermHandle hTerm, const void *inputPtr, Ptr *outputPtr, short language)
  371. ;
  372.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  373.         IMPORT_CFM_FUNCTION TMEnglishToIntl
  374.     ENDIF
  375.  
  376. ;
  377. ; pascal void TMGetToolName(short id, Str255 name)
  378. ;
  379.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  380.         IMPORT_CFM_FUNCTION TMGetToolName
  381.     ENDIF
  382.  
  383. ;
  384. ; pascal short TMGetProcID(ConstStr255Param name)
  385. ;
  386.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  387.         IMPORT_CFM_FUNCTION TMGetProcID
  388.     ENDIF
  389.  
  390. ;
  391. ; pascal void TMSetRefCon(TermHandle hTerm, long refCon)
  392. ;
  393.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  394.         IMPORT_CFM_FUNCTION TMSetRefCon
  395.     ENDIF
  396.  
  397. ;
  398. ; pascal long TMGetRefCon(TermHandle hTerm)
  399. ;
  400.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  401.         IMPORT_CFM_FUNCTION TMGetRefCon
  402.     ENDIF
  403.  
  404. ;
  405. ; pascal void TMSetUserData(TermHandle hTerm, long userData)
  406. ;
  407.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  408.         IMPORT_CFM_FUNCTION TMSetUserData
  409.     ENDIF
  410.  
  411. ;
  412. ; pascal long TMGetUserData(TermHandle hTerm)
  413. ;
  414.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  415.         IMPORT_CFM_FUNCTION TMGetUserData
  416.     ENDIF
  417.  
  418. ;
  419. ; pascal short TMAddSearch(TermHandle hTerm, ConstStr255Param theString, const Rect *where, TMSearchTypes searchType, TerminalSearchCallBackUPP callBack)
  420. ;
  421.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  422.         IMPORT_CFM_FUNCTION TMAddSearch
  423.     ENDIF
  424.  
  425. ;
  426. ; pascal void TMRemoveSearch(TermHandle hTerm, short refnum)
  427. ;
  428.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  429.         IMPORT_CFM_FUNCTION TMRemoveSearch
  430.     ENDIF
  431.  
  432. ;
  433. ; pascal void TMClearSearch(TermHandle hTerm)
  434. ;
  435.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  436.         IMPORT_CFM_FUNCTION TMClearSearch
  437.     ENDIF
  438.  
  439. ;
  440. ; pascal Point TMGetCursor(TermHandle hTerm, TMCursorTypes cursType)
  441. ;
  442.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  443.         IMPORT_CFM_FUNCTION TMGetCursor
  444.     ENDIF
  445.  
  446. ;
  447. ; pascal TMErr TMGetTermEnvirons(TermHandle hTerm, TermEnvironRec *theEnvirons)
  448. ;
  449.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  450.         IMPORT_CFM_FUNCTION TMGetTermEnvirons
  451.     ENDIF
  452.  
  453. ;
  454. ; pascal short TMChoose(TermHandle *hTerm, Point where, TerminalChooseIdleUPP idleProc)
  455. ;
  456.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  457.         IMPORT_CFM_FUNCTION TMChoose
  458.     ENDIF
  459.  
  460. ;
  461. ; pascal void TMEvent(TermHandle hTerm, const EventRecord *theEvent)
  462. ;
  463.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  464.         IMPORT_CFM_FUNCTION TMEvent
  465.     ENDIF
  466.  
  467. ;
  468. ; pascal Boolean TMDoTermKey(TermHandle hTerm, ConstStr255Param theKey)
  469. ;
  470.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  471.         IMPORT_CFM_FUNCTION TMDoTermKey
  472.     ENDIF
  473.  
  474. ;
  475. ; pascal short TMCountTermKeys(TermHandle hTerm)
  476. ;
  477.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  478.         IMPORT_CFM_FUNCTION TMCountTermKeys
  479.     ENDIF
  480.  
  481. ;
  482. ; pascal void TMGetIndTermKey(TermHandle hTerm, short id, Str255 theKey)
  483. ;
  484.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  485.         IMPORT_CFM_FUNCTION TMGetIndTermKey
  486.     ENDIF
  487.  
  488. ;
  489. ; pascal void TMGetErrorString(TermHandle hTerm, short id, Str255 errMsg)
  490. ;
  491.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  492.         IMPORT_CFM_FUNCTION TMGetErrorString
  493.     ENDIF
  494.  
  495.     ENDIF ; __TERMINALS__ 
  496.  
  497.